package com.huaxin.hxmoduleworkorder.models;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.huaxin.hxmoduleworkorder.common.enums.MaintenanceOrderElectricianTaskStatus;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

@Data
@TableName("maintenance_order_electrician")
@EqualsAndHashCode(callSuper = true)
public class MaintenanceOrderElectricianTask extends BaseModel {
    @TableField(value = "maintenance_order_id")
    @Schema(description = "维修工单ID", example = "mnt_order_001")
    private String maintenanceOrderId;

    @TableField(value = "electrician_id")
    @Schema(description = "电工ID", example = "e1001")
    private String electricianId;

    @TableField(value = "responsibility")
    @Schema(description = "负责内容描述", example = "负责线路检测与修复")
    private String responsibility;

    @TableField(value = "assign_at")
    @Schema(description = "分配时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime assignAt;

    @TableField(value = "accept_at")
    @Schema(description = "接单时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime acceptAt;

    @TableField(value = "reject_at")
    @Schema(description = "驳回时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime rejectAt;

    @TableField(value = "reject_reason")
    @Schema(description = "驳回原因", example = "信息不完整")
    private String rejectReason;

    @TableField(value = "on_site_at")
    @Schema(description = "到场时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime onSiteAt;

    @TableField(value = "resolve_at")
    @Schema(description = "处理完成时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime resolveAt;

    @TableField(value = "status")
    @Schema(description = "该电工的处理状态：assigned/arrived/working/finished/rejected/cancelled", example = "assigned")
    private MaintenanceOrderElectricianTaskStatus status;
}

